package cn.touna.jss.common.properties.disconf;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import org.springframework.stereotype.Component;

/**
 * 电话帮配置
 */
@Component
@DisconfFile(targetDirPath = "disconf", filename = "dianhuabang.properties")
public class DianHuaBangProperties {
    private String url;
    private String apikey;
    private String appsecret;
    private int interval = 500;//ms
    private int retryCount = 60;

    @DisconfFileItem(name = "dianhuabang.retryCount", associateField = "retryCount")
    public int getRetryCount() {
        return retryCount;
    }

    public void setRetryCount(int retryCount) {
        this.retryCount = retryCount;
    }

    @DisconfFileItem(name = "dianhuabang.interval", associateField = "interval")
    public int getInterval() {
        return interval;
    }

    public void setInterval(int interval) {
        this.interval = interval;
    }

    @DisconfFileItem(name = "dianhuabang.url", associateField = "url")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @DisconfFileItem(name = "dianhuabang.apikey", associateField = "apikey")
    public String getApikey() {
        return apikey;
    }

    public void setApikey(String apikey) {
        this.apikey = apikey;
    }

    @DisconfFileItem(name = "dianhuabang.appsecret", associateField = "appsecret")
    public String getAppsecret() {
        return appsecret;
    }

    public void setAppsecret(String appsecret) {
        this.appsecret = appsecret;
    }

    @Override
    public String toString() {
        return "DianHuaBangProperties{" +
                "url='" + url + '\'' +
                ", apikey='" + apikey + '\'' +
                ", appsecret='" + appsecret + '\'' +
                '}';
    }
}
